import { defineStore } from 'pinia';

/**
 * 布局配置
 * 修复：https://gitee.com/lyt-top/vue-next-admin/issues/I567R1，感谢@lanbao123
 * 2020.05.28 by lyt 优化。开发时配置不生效问题
 * 修改配置时：
 * 1、需要每次都清理 `window.localStorage` 浏览器永久缓存
 * 2、或者点击布局配置最底部 `一键恢复默认` 按钮即可看到效果
 */

export const useThemeConfig = defineStore('themeConfig', {
	state: (): ThemeConfigState => ({
		themeConfig: { "isDrawer": false, "primary": "#000000", "isIsDark": false, "topBar": "#409EFF", "topBarColor": "#606266", "isTopBarColorGradual": false, "menuBar": "#007DFE", "menuBarColor": "#eaeaea", "menuBarActiveColor": "rgba(0, 0, 0, 0.3)", "isMenuBarColorGradual": true, "columnsMenuBar": "#545c64", "columnsMenuBarColor": "#e6e6e6", "isColumnsMenuBarColorGradual": false, "isColumnsMenuHoverPreload": false, "isCollapse": false, "isUniqueOpened": true, "isFixedHeader": true, "isFixedHeaderChange": false, "isClassicSplitMenu": false, "isLockScreen": false, "lockScreenTime": 30, "isShowLogo": true, "isShowLogoChange": false, "isBreadcrumb": true, "isTagsview": true, "isBreadcrumbIcon": true, "isTagsviewIcon": true, "isCacheTagsView": true, "isSortableTagsView": true, "isShareTagsView": true, "isFooter": false, "isGrayscale": false, "isInvert": false, "isWartermark": false, "wartermarkText": "福州海洋浮标", "tagsStyle": "tags-style-one", "animation": "slide-right", "columnsAsideStyle": "columns-round", "columnsAsideLayout": "columns-vertical", "layout": "classic", "isRequestRoutes": true, "globalTitle": "数据查询系统", "globalViceTitle": "数据查询系统", "globalViceTitleMsg": "数据查询系统", "globalI18n": "zh-cn", "globalComponentSize": "large" },
	}),
	actions: {
		setThemeConfig(data: ThemeConfigState) {
			this.themeConfig = data.themeConfig;
		},
	},
});
